package deneme.com;

public   class GenericListTest {

	public static void main(String[] args) {

		Person person1 = new Person();
		person1.setAd("Erkan");
		person1.setSoyad("Yildirim");
		person1.setYas(10L);

		Person person2 = new Person();
		person2.setAd("Sibel");
		person2.setSoyad("narin");
		person2.setYas(10L);

		GenericList<Person> genericList = new GenericList<Person>();
		genericList.add(person1);
		genericList.add(person2);

		for (Person person : genericList.list()) {

			System.out.println("Ad=" + person.getAd());
			System.out.println("Soyad=" + person.getSoyad());
			System.out.println("Yas=" + person.getYas());
			
			System.out.println();
			System.out.println("----------------------------------");
		}

		genericList.remove(0);
		
		

		for (Person person :genericList.list()) {

			System.out.println("Ad=" + person.getAd());
			System.out.println("Soyad=" + person.getSoyad());
			System.out.println("Yas=" + person.getYas());

		}
		
		genericList.clear();
		
		System.out.println("-----------------------------");
		
		
		
		for (Person person : genericList.list()) {

			System.out.println("Ad=" + person.getAd());
			System.out.println("Soyad=" + person.getSoyad());
			System.out.println("Yas=" + person.getYas());

		}
		
		
		if(genericList.isEmpty()){
			System.out.println("List is Empty");
		}

	}
}
